package com.shop.Control;

import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.shop.service.MerchantServiceImpl;
/**
 * 
 * <b>商户index页面的初始<b>
 * @author 威 
 * <br>2018年12
 *
 */
public class MerchantIndexAction extends SuperActionSupport {
	private static final long serialVersionUID = 7539369474585568995L;
	
	public MerchantServiceImpl getService(){
		return (MerchantServiceImpl) getBean("merchantServiceImpl") ;
	}
	
	public String execute(){
		ActionContext context = ActionContext.getContext() ;
		Map<String, Object> session = context.getSession() ;
		Integer merchantId = (Integer) session.get("merchant_id") ;
		System.out.println("主页的id为："+merchantId) ;
		print(getService().getGoods2(merchantId)) ;
		return SUCCESS ;
	}
	/**
	 * 初始化页面
	 * <p>	 
	 * 1、页面数据
	 * 2、右栏数据
	 * @return
	 * String
	 * @see
	 * @since 1.0
	 */
	public String initPage(){
		print("get");
		return SUCCESS;
	}
	/**
	 * 点击跳转到商品页
	 * <p>	 
	 * 
	 * @return
	 * String
	 * @see
	 * @since 1.0
	 */
	public String clickGoods(){
		print("get");
		return SUCCESS;
	}
}
